package at.ac.tuwien.swa.sparrow.server

import at.ac.tuwien.swa.sparrow.common._
import com.google.common.net.HostAndPort
import java.util.UUID

trait PeerService {

	def register(username: String, password: String): UUID

	def login(peerId: UUID, address: HostAndPort): PeerInfo

	def logout(peerId: UUID)

	def lookup(n: Int): Set[PeerInfo]

	def lookup(exclude: Set[HostAndPort] = Set.empty, n: Int = 10): Set[PeerInfo]

	def update(peerInfo: Set[PeerInfo])

	def update(ticket: Ticket, trackInfo: Option[TrackInfo])

}
